
# 代理池随机调取函数
import requests

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36',
    'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3',
    'Accept-Encoding': 'gzip, deflate, br',
    'Content-Type': 'application/x-www-form-urlencoded',
    'Accept-Language': 'zh-CN,zh;q=0.9',
    'Cache-Control': 'max-age=0',
    'Host': 'weixin.sogou.com',
    'Connection': 'keep-alive'
}


def get_proxy():
    return requests.get("http://127.0.0.1:5010/get/").content.decode('utf8')
proxy = get_proxy()
print(proxy)


html = requests.get('http://www.tbzhu.com',headers = headers,proxies={"https": "http://{}".format(proxy)})
